package com.taobao.dao.impl;

import java.util.HashMap;
import java.util.Map;

import com.taobao.dao.CommonDao;
import com.taobao.dao.RobTaskDao;
import com.taobao.pojo.Config;
import com.taobao.pojo.HttpContext;
import com.taobao.pojo.Task;

public class RobTaskDaoImpl extends CommonDao implements RobTaskDao {

    @Override
    public Object process(HttpContext context) throws Exception {
        String html = context.getHtml();
        return html;
    }

    @Override
    public String robTask(Task task) throws Exception {
        Map<String, String> params = new HashMap<String, String>();
        params.put("tid", task.getId() + "");
        return (String) postRequest(Config.url + "GetTasks.aspx", Config.url + "room.aspx", params);
    }

    public static void main(String[] args) throws Exception {
        Task task = new Task();
        task.setId(20111210104241840l);
        new RobTaskDaoImpl().robTask(task);
    }

}
